# 设置CMake的最小版本
cmake_minimum_required(VERSION 3.15)

# 项目名称
#   项目可以包含多个目标(target)
#   target: 可执行程序, 静态库, 动态库
project(CloudDisk_v3)

# 指定C++的版本: -std=c++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置可执行程序生成的路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../)


# 生成的可执行程序
add_executable(server
    main.cpp
    CloudiskServer.cpp
    CryptoUtil.cpp
)

add_executable(Ossbackup
    Ossbackup.cpp
)


# 设置编译选项
target_compile_options(server PRIVATE
    -fno-rtti
    -g
)

target_compile_options(Ossbackup PRIVATE
    -fno-rtti
    -g
    -DDEBUG
)


# 设置需要链接的库
target_link_libraries(server PRIVATE    
    wfrest
    crypto
    ssl
    jwt
    SimpleAmqpClient
)

target_link_libraries(Ossbackup PRIVATE    
    alibabacloud-oss-cpp-sdk
    curl
    crypto
    ssl
    jwt
    pthread
    SimpleAmqpClient
)